<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="jspf/jsp_header.jspf"%>
<fmt:setTimeZone value="${sessionScope.JRED_TIME_ZONE}" scope="session" />

<%@ include file="jspf/topbar.jspf"%>
<table width="970" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td class="center-bg">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="bbslist01-titletxt" width="10%">
						status
					</td>
					<td class="bbslist01-titletxt">
						论坛
					</td>
					<td class="bbslist01-titletxt" width="10%">
						主题数
					</td>
					<td class="bbslist01-titletxt" width="30%">
						最新
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				class="bbslist01-table">

				<c:choose>
					<c:when test="${!empty requestScope.JFORUM_GROUPS}">
						<c:forEach items="${requestScope.JFORUM_GROUPS}" var="group">
							<tr>
								<td class="bbslist01-titlebg" colspan="5">
									&nbsp;
									<c:out value="${group.group_name}" />
								</td>
							</tr>
							<c:choose>
								<c:when test="${!empty group.forums}">
									<c:forEach items="${group.forums}" var="forum"
										varStatus="status">
										<c:set var="lastmessage" value="${forum.lastMessage}" />
										<tr>
											<td class="bbslist01-list" width="10%" align="center">

											</td>
											<td class="bbslist01-list" colspan="2">
												<a
													href="<c:url value="ShowForum.do">
			                                                <c:param name="fid" value="${forum.forumid}"/>
                                                       </c:url>"
													class="forum_name"><c:out value="${forum.forumtitle}" />
												</a>
												<br>
												<span class="txt"><c:out value="${forum.forumdesc}" />
												</span>
												<br>
												<span class="txt"><c:out value="分类：" /> </span>
												<c:choose>
													<c:when test="${!empty forum.tagList}">
														<c:forEach items="${forum.tagList}" var="tag">
															<a	href="<c:url value="ShowForum.do"><c:param name="fid" value="${forum.forumid}"/><c:param name="tagid" value="${tag.tagid}"/></c:url>"><c:out value="${tag.tagname}" />
															</a>
														</c:forEach>
													</c:when>
													<c:otherwise>
														<fmt:message key="global.NONE" />
													</c:otherwise>
												</c:choose>
											</td>
											<td class="bbslist01-list" width="10%" align="center">
												<c:out value="${forum.threadsCount}" />
											</td>
											<td class="bbslist01-list" width="30%">
												<c:choose>
													<c:when test="${forum.threadsCount>0}">
														<span class="txt"><a
															href="<c:url value="ShowMessage.do">
                                       <c:param name="fid" value="${forum.forumid}"/>
                                       <c:param name="tid" value="${forum.lastMessThreadId}"/>
                                       <c:param name="mid" value="${lastmessage.id}"/>
                                   </c:url>"><jforum:process
																	cutToLength="26" value="${lastmessage.contents}" /> </a> <br>
															<fmt:formatDate value="${lastmessage.intime}" type="both"
																dateStyle="medium" timeStyle="short" /> </span>
													</c:when>
													<c:otherwise>
														<fmt:message key="global.NONE" />
													</c:otherwise>
												</c:choose>

											</td>
										</tr>
									</c:forEach>
								</c:when>
								<c:otherwise>
									<tr>
										<td class="bbslist01-titlebg" colspan="5">
											<fmt:message key="forum.NO_FORUMS" />
											!
											<c:if test="${sessionScope.JRF_USER.status==10}">
                     [ <a
													href="<c:url value="showAddForum.do">
			                       <c:param name="groupid" value="${group.groupid}"/>
                                </c:url>"><fmt:message
														key="global.CREATE_SOME" /> </a> ]
                	</c:if>
										</td>
									</tr>
								</c:otherwise>
							</c:choose>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<tr>
							<td class="bbslist01-titlebg" colspan="5">
								<fmt:message key="global.ERROR" />
								!
								<br>
								<fmt:message key="forum.NFTD" />
								!
								<c:if test="${sessionScope.JRF_USER.status==10}">
									<html:link styleClass="control" action="showAddGroup">
										<fmt:message key="global.CREATE_SOME" />
									</html:link>
								</c:if>
								<br>
							</td>
						</tr>
					</c:otherwise>
				</c:choose>
			</table>
		</td>
	</tr>
</table>
